package net.oschina.app.testscripts.examples.addtofavorites;

import net.oschina.app.BasicTestCase;

/**
 * Created by Aaron on 2017/10/29.
 */

public class AddToFavorites extends BasicTestCase {


    public void testName() throws Exception {
            helper.getPageCommon().goToMySettingsTab();
            helper.getPageMySettings().clickLoginIcon();
            helper.getPageLogin().login("735723619@qq.com","12345678");
            helper.getPageCommon().goToHomeTab();
            String title = helper.getPageHome().getNewsTitle(3);
            helper.getPageHome().clickListItem(2);
            Thread.sleep(6000);
            helper.getPageNewsDetail().clickFavoriteBtn();
            Thread.sleep(1000);
            helper.getPageCommon().goBack();

            helper.getPageCommon().goToMySettingsTab();
            helper.getPageMySettings().clickFavoritesLayout();
            String actualNewsTitle = helper.getPageFavoritesList().getNewsTitle(1);
            assertTrue(title.contains(actualNewsTitle));

    }
}
